if (model)
{
GListModel *store;
- guint position;
+ guint position, len;
- store = gtk_flatten_list_model_get_model (model);
+ store = gtk_flatten_list_model_get_model (model);
#if 0 && GLIB_CHECK_VERSION(2,64,0)
if (_g_list_store_find (G_LIST_STORE (store), controller, &position))
g_list_store_remove (G_LIST_STORE (store), position);
#else
- for (position = 0; position < g_list_model_get_n_items (G_LIST_MODEL (store)); position++)
+ for (position = 0, len = g_list_model_get_n_items (store); position < len; position++)
{
- GtkShortcutController *item = g_list_model_get_item (G_LIST_MODEL (store), position);
+ GtkShortcutController *item = g_list_model_get_item (store, position);
g_object_unref (item);
if (item == controller)
{